import { onMounted, onUnmounted, ref } from 'vue'
const width = ref(0)
export const useSize = () => (width.value = window.innerWidth)
onMounted(() => {
  useSize()
  window.addEventListener('resize', useSize)
})
onUnmounted(() => {
  window.removeEventListener('resize', useSize)
})

export { width }
